keys_released

This function returns a list of all the keys on the keyboard that have just been released.

int[] keys_released()

Parameters:
None.

Return value:
An array with the keys that have just been released, or an empty array if no keys have been released since the last call or if an error occurs.

Remarks:
The difference between keys_up and keys_released is that keys_released will only return a list of the keys that the user has just released, while keys_up will return a list of the keys that are currently up regardless of whether the same keys have been reported as being up in a previous call.

Please note that keys_released and key_released use the same keyboard state, so if a call to keys_released is made right before a call to key_released, none of the keys returned by keys_released will be reported as just having been released by key_released. The same holds true for the reverse scenario.

Example:
// Speak the key codes of any keys that are released, and exit if the user presses escape.

void main()
{
show_game_window("Keys released Test");
tts_voice speech;
int[] list;
while(key_pressed(KEY_ESCAPE)==false)
{
list=keys_released();
for(uint i=0;i<list.length();i++)
{
if(i==0)
{
speech.speak_interrupt(list[i]);
}
else
{
speech.speak(list[i]);
}
}
wait(5);
}
}